Add two users of gtk_widget_insert_action_group
authorLars Uebernickel <lars.uebernickel@canonical.com>
Fri, 17 Aug 2012 22:21:59 +0000 (18:21 -0400)
committerRyan Lortie <desrt@desrt.ca>
Mon, 20 Aug 2012 17:11:01 +0000 (13:11 -0400)
Each GtkWindow with an associated GtkApplication should add this as
"app" to its action context.  Each GtkApplicationWindow is its own
GActionGroup, and it should add itself to itself with the prefix "win".

There is now some duplication here because we have the new GActionMuxer
hierarchy managed by GtkWidget, but GtkApplicationWindow still carries
its own muxer.  The redundancy will be removed in a future patch.

gtk/gtkapplicationwindow.c
gtk/gtkwindow.c

index fff5380a299da47011a665fe7cde9556ab8c0c4a..7061309463f20794f57cea2f373f8b5e5765083b 100644 (file)
@@ -959,6 +959,8 @@ gtk_application_window_init (GtkApplicationWindow *window)
   window->priv->accels = gtk_accel_group_new ();
   gtk_window_add_accel_group (GTK_WINDOW (window), window->priv->accels);
 
+  gtk_widget_insert_action_group (GTK_WIDGET (window), "win", G_ACTION_GROUP (window->priv->actions));
+
   /* window->priv->actions is the one and only ref on the group, so when
    * we dispose, the action group will die, disconnecting all signals.
    */
index a07ddc58e733e4b10fec88f2fcb2fb7e9e1d2d1d..0d62acc4033158837a3a5364b97995a0a24a6e51 100644 (file)
@@ -2820,6 +2820,9 @@ gtk_window_set_application (GtkWindow      *window,
           gtk_application_add_window (priv->application, window);
         }
 
+      /* don't use a normal cast: application may be NULL */
+      gtk_widget_insert_action_group (GTK_WIDGET (window), "app", (GActionGroup *) application);
+
       g_object_notify (G_OBJECT (window), "application");
     }
 }